package com.hitemole.screen;

import com.badlogic.gdx.Gdx;
import com.badlogic.gdx.Screen;
import com.badlogic.gdx.graphics.GL10;
import com.hitemole.controller.ScoreController;
import com.hitemole.game.GameCore;
import com.hitemole.levelObject.Scores;
import com.hitemole.manager.ScoreManager;
import com.hitemole.view.ScoreRenderer;

public class MultiplayerScoreScreen implements Screen{
	private ScoreManager world;
	private ScoreController controller;
	private ScoreRenderer renderer;
	private GameCore core;
	private Scores score;
	
	
	public MultiplayerScoreScreen(GameCore core) {
		// TODO Auto-generated constructor stub
		this.core=core;
	}	
	
	@Override
	public void render(float delta) {
		// TODO Auto-generated method stub
		Gdx.gl.glClearColor(0.1f, 0.1f, 0.1f, 1);
		Gdx.gl.glClear(GL10.GL_COLOR_BUFFER_BIT);
		controller.update(delta);
		renderer.render();
	}

	@Override
	public void resize(int width, int height) {
		// TODO Auto-generated method stub
		renderer.setSize(width,height);
	}

	@Override
	public void show() {
		// TODO Auto-generated method stub
		world = new ScoreManager(core,score);
		controller = new ScoreController(world);
		renderer = new ScoreRenderer(world);
		Gdx.input.setInputProcessor(world.getStage());
	}

	@Override
	public void hide() {
		// TODO Auto-generated method stub
		
	}

	@Override
	public void pause() {
		// TODO Auto-generated method stub
		
	}

	@Override
	public void resume() {
		// TODO Auto-generated method stub
		core.resumeScreen(core.getScoreScreen(score));
		core.setScreen(core.getResourceScreen());
	}

	@Override
	public void dispose() {
		// TODO Auto-generated method stub
		
	}

	public void setScore(Scores score) {
		// TODO Auto-generated method stub
		this.score=score;
	}

}
